/**
 * 
 */
package kr.co.insoft.driver.amazon.model;

import java.util.ArrayList;
import java.util.List;

import kr.co.insoft.driver.model.VolumeModel;

import com.amazonaws.services.ec2.model.Volume;
import com.amazonaws.services.ec2.model.VolumeAttachment;

/**
 * @author IN-SOFT Inc. GoodwillDD(sylee@in-soft.co.kr)
 * 
 */
public class AmazonVolumeModel extends VolumeModel {
	/**
	 * 
	 */
	private static final long serialVersionUID = -1662270155239302847L;

	public AmazonVolumeModel(Volume volume) {
		setVolumeId(volume.getVolumeId());
		setSize(volume.getSize());
		setSnapshotId(volume.getSnapshotId());
		setAvailabilityZone(volume.getAvailabilityZone());
		setState(volume.getState());
		setCreateTime(volume.getCreateTime());
		setVolumeType(volume.getVolumeType());
		setIops(volume.getIops());
		List<AmazonVolumeAttachmentModel> attachments = new ArrayList<AmazonVolumeAttachmentModel>();
		setAttachments(attachments);
		for (VolumeAttachment attachment : volume.getAttachments()) {
			attachments.add(new AmazonVolumeAttachmentModel(attachment));
		}
		setAttachments(attachments);
	}
}
